///<reference path='../../../../utils/commons/event.ts'/>
///<reference path='../../../../utils/commons/array-collection.ts'/>
///<reference path='../model/v2/base/SDMXArtefact.ts'/>

import ev = module("utils/commons/event");
import ac = module("utils/commons/array-collection");
import sa = module("main/org/sdmx/model/v2/base/SDMXArtefact");

/** 
* This event holds SDMX artefacts (e.g.: DataSet, etc), such as, for 
* instance, the artefacts returned after parsing SDMX-ML data files.
* 
* @author Xavier Sosnovsky, Anthony Morel
*/
export class SDMXDataEvent extends ev.SDMXEvent {
    	
    /*==============================Fields================================*/
        
    private data:sa.SDMXArtefact;
        
    /*===========================Constructor==============================*/
        
    constructor(data:sa.SDMXArtefact, type) 
    {
        super(type);
        this.data = data;
    }
        
    /*==========================Public methods============================*/
        
    /**
        * @private 
        */
    public clone():SDMXDataEvent 
    {
        return new SDMXDataEvent(this.data, this.getType());
    }
        
    /**
        * The SDMX artefact contained in the dispatched event 
        */
    public getData():sa.SDMXArtefact 
    {
        return this.data;
    }
}